<template>

</template>

<script>
    export default {
        name: "Gd",
      data(){
          return{
             loginh5:0,
          }
      },
      methods:{

      },
		
      mounted(){
          // alert(this.$route.path);
					// console.log(sessionStorage.getItem('logintap'));
					// console.log(this.$route.query.r);
        if (this.$route.query.r){

					var r = JSON.parse(this.$route.query.r);

					if(r.errcode=='0'||r.errcode==0){
						if(r.data.is_band_mobile==0||r.data.is_band_mobile=='0'){
							// alert(r.data.tempid);
							this.$router.push({
								path:'/tel',
								query:{
									tempid:r.data.tempid,
									oldid:r.data.oldid
								}
							})
						}else{
							sessionStorage.setItem('fan',123);
							localStorage.setItem('token',r.data.token);

							var ua = navigator.userAgent.toLowerCase();
							var isWeixin = ua.indexOf('micromessenger') != -1;
								if (isWeixin) {
									// var url = decodeURIComponent(localStorage.getItem('hrefurl'));
									

								if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) { //移动端
									this.$router.go(-1)
								}else {
									this.$router.go(-2)
								}
								} else {
								this.$router.push({
									path:'/user'
								})
								}

						}
					}else{
						this.$toast({
							message:r.msg,
							position:'bottom'
						});
					}

        }else {
          if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) { //移动端
            this.$router.go(-1)
          }else {
            this.$router.go(-2)
          }
        }
      }
    }
</script>

<style scoped>

</style>
